PROJECT(Chronos-engine)
SET(CMAKE_BUILD_TYPE Release)
SET(CMAKE_VERBOSE_MAKEFILE false)
ADD_DEFINITIONS(-Wall -Wextra)

ADD_CUSTOM_COMMAND(
  OUTPUT svnversion.h
  DEPENDS ${CMAKE_SOURCE_DIR}/.svn/entries
  COMMAND ${CMAKE_SOURCE_DIR}/gensvnversion.sh ARGS ${CMAKE_SOURCE_DIR}
)
ADD_CUSTOM_TARGET(svncheck ALL
  DEPENDS svnversion.h
)


ADD_EXECUTABLE(server
  main.cpp
)
# NOTE: pthread and dl are needed for sqlite3
TARGET_LINK_LIBRARIES(server chronos)


ADD_LIBRARY(chronos SHARED
  Activity.cpp
  AdminCommands.cpp
  AliasList.cpp
  Area.cpp
  AreaBuilder.cpp
  CommChannel.cpp
  CommServer.cpp
  Commands.cpp
  Connection.cpp
  Database.cpp
  Effects.cpp
  ElevatorController.cpp
  Equipment.cpp
  EventServer.cpp
  InstancePortal.cpp
  ItemContainer.cpp
  ItemDb.cpp
  KillStats.cpp
  Logger.cpp
  LoginSession.cpp
  Messages.cpp
  MudConsumable.cpp
  MudContainer.cpp
  MudCorpse.cpp
  MudCreature.cpp
  MudCreatureConductorTask.cpp
  MudCredits.cpp
  MudDoor.cpp
  MudExit.cpp
  MudItem.cpp
  MudKey.cpp
  MudMobile.cpp
  MudMobileRegenTask.cpp
  MudObject.cpp
  MudPlayer.cpp
  MudServer.cpp
  MudWearable.cpp
  ParserFactory.cpp
  PlayerCreationSession.cpp
  PlayerSession.cpp
  PlayerSettings.cpp
  PromptBuilder.cpp
  Respawner.cpp
  Room.cpp
  SessionManager.cpp
  SqliteDatabase.cpp
  Stats.cpp
  StringBuilder.cpp
  Table.cpp
  TaskQueue.cpp
  Trade.cpp
  TrainTask.cpp
  Utils.cpp
  VerbParser.cpp
  Words.cpp
  World.cpp
  myassert.cpp
)
TARGET_LINK_LIBRARIES(chronos sqlite3 pthread dl)

ADD_DEPENDENCIES(server svncheck)
ADD_DEPENDENCIES(chronos svncheck)

SUBDIRS(sqlite test)

